package actions.complaints;

import actions.base.BaseAction;

public class DeleteMulti extends BaseAction {
	
	int[] complaints;
	
	@Override
	public String execute() throws Exception {
		String ids = "";
		for (int i = 0; i < complaints.length; i++) {
			ids += complaints[i] + ",";
		}
		ids = ids.substring(0, ids.length() - 1);
		if(services.deleteMultiComplaintByIds(ids) > 0)
			return redirect("Listing.action");
		return ERROR;
	}

	/**
	 * @return the complaints
	 */
	public int[] getComplaints() {
		return complaints;
	}

	/**
	 * @param complaints the complaints to set
	 */
	public void setComplaints(int[] complaints) {
		this.complaints = complaints;
	}
	
}
